package single_game.logic.race_simulator.race_team;

import java.util.ArrayList;

import single_game.logic.race_simulator.race_team.my_riders_actions.MyRiderInRelayQueue;
import single_game.logic.race_simulator.race_team.my_riders_actions.MyRiderMaintainPosition;
import single_game.logic.race_simulator.race_team.my_riders_actions.MyRiderRelay;
import single_game.logic.race_simulator.race_team.my_riders_actions.MyRiderSlowDown;
import single_game.logic.race_simulator.race_team.my_riders_actions.MyRiderStayBehind;



public class MyTeamSimulator {
	
	private ArrayList<RaceRider> myTeam;
	
	public MyTeamSimulator(ArrayList<RaceRider> myTeam) {
		this.myTeam = myTeam;
	}
	
public void makeDecision() {
		
		for (int i = 0; i < myTeam.size(); i++) {
			if (myTeam.get(i).getAction().equals("Maintain Position")) {
				MyRiderMaintainPosition.simulateRiderAction(myTeam.get(i));
			}
			else if (myTeam.get(i).getAction().equals("Relay Queue")) {
				MyRiderInRelayQueue.simulateRiderAction(myTeam.get(i));
			}
			else if (myTeam.get(i).getAction().equals("Relay")) {
				MyRiderRelay.simulateRiderAction(myTeam.get(i));
			}
			else if (myTeam.get(i).getAction().equals("Stay Behind")) {
				MyRiderStayBehind.simulateRiderAction(myTeam.get(i));
			}
			else if (myTeam.get(i).getAction().equals("Slow Down")) {
				MyRiderSlowDown.simulateRiderAction(myTeam.get(i));
			}
		}		
	}
	
	public void newStage() {
		double startPuls = 120;
		double stamina = 100;
		double energy = 100;
		String action = "Maintain Position";
		
		for (int i = 0; i < myTeam.size(); i++) {
			myTeam.get(i).setPuls(startPuls);
			myTeam.get(i).setStamina(stamina);
			myTeam.get(i).setEnergy(energy);
			myTeam.get(i).setAction(action);
			myTeam.get(i).setPower(50);
		}
	}

}
